function rptPath = getRptPath(type, mdlName)
%GETRPTPATH 获取指定报告类型和模型的报告文件路径
%   此函数根据报告类型和模型名称，生成对应的报告文件完整路径。
%   支持多种报告类型，使用改进的配置管理系统。
%
%语法:
%   rptPath = getRptPath(type, mdlName)
%
%输入参数:
%   type - 报告类型（字符串），支持的类型包括：
%          'SDD report' - 软件设计描述报告
%          'model standards' - 模型标准检查报告  
%          'model metrics' - 模型度量报告
%          'design error detection' - 设计错误检测报告
%          'code as top' - 顶层模型代码报告
%          'code as ref' - 引用模型代码报告
%          'code inspector' - 代码检查报告
%          'code standards' - 代码标准检查报告
%          'bug finder' - 缺陷查找报告
%          'code prover' - 代码证明报告
%          'code metrics' - 代码质量指标报告
%   mdlName - 模型名称（字符串）
%
%输出参数:
%   rptPath - 报告文件的完整路径（字符串）
%
%说明:
%   - 使用ProjectNamingManager.getNameStr获取报告名称
%   - 使用ProjectPathManager.getDirPath获取报告目录路径
%   - 使用getReportFormatConfig获取报告格式（默认为DEV环境）
%   - 不同类型的报告存储在不同的目录结构中
%   - 代码报告会添加'html'子目录
%
%示例:
%   % 获取SDD报告路径
%   sddPath = getRptPath('SDD report', 'MyModel');
%
%   % 获取模型标准检查报告路径
%   stdPath = getRptPath('model standards', 'MyModel');
%
%   % 获取代码检查报告路径
%   codePath = getRptPath('code inspector', 'MyModel');
%
%依赖项:
%   ProjectNamingManager.getNameStr - 获取标准化名称
%   ProjectPathManager.getDirPath - 获取目录路径
%   getReportFormatConfig - 获取报告格式配置
%
%参见:
%   ProjectNamingManager, ProjectPathManager, getReportFormatConfig
%

%版本: 2.0 (改进版本)
%日期: 2024
%


% Helper function to get report format based on type
    function format = getReportFormat(reportType)
        % For getRptPath, we typically assume DEV environment unless specified otherwise
        % This can be enhanced later to detect environment from context
        format = getReportFormatConfig(reportType, 'DEV');
    end

switch type
    case 'SDD report'
        Name = ProjectNamingManager.getNameStr('SDD report', mdlName);
        Path = ProjectPathManager.getDirPath('SDD report', mdlName);
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, Name), '.', rptFormat];
        
    case 'model standards'
        Name = ProjectNamingManager.getNameStr('model standards report', mdlName);
        Path = ProjectPathManager.getDirPath('model standards', mdlName);
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, Name), '.', rptFormat];
        
    case 'model metrics'
        Name = ProjectNamingManager.getNameStr('model metrics report', mdlName);
        Path = ProjectPathManager.getDirPath('model metrics', mdlName);
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, Name), '.', rptFormat];
        
    case 'design error detection'
        Name = ProjectNamingManager.getNameStr('design error detection report', mdlName);
        Path = ProjectPathManager.getDirPath('design error detection', mdlName);
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, Name), '.', rptFormat];
        
    case 'code as top'
        Name = ProjectNamingManager.getNameStr('code report', mdlName);
        Path = ProjectPathManager.getDirPath('top model code', mdlName);
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, 'html', Name), '.', rptFormat];
        
    case 'code as ref'
        Name = ProjectNamingManager.getNameStr('code report', mdlName);
        Path = ProjectPathManager.getDirPath('ref model code', mdlName);
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, 'html', Name), '.', rptFormat];
        
    case 'code inspector'
        % 假设存在code inspector报告配置
        Name = ProjectNamingManager.getNameStr('code inspector report', mdlName);
        Path = ProjectPathManager.getDirPath('code review', mdlName);
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, Name), '.', rptFormat];
        
    case 'code standards'
        Name = ProjectNamingManager.getNameStr('code standards report', mdlName);
        Path = ProjectPathManager.getDirPath('code standards', mdlName);
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, Name), '.', rptFormat];
        
    case 'bug finder'
        Name = ProjectNamingManager.getNameStr('bug finder report', mdlName);
        Path = ProjectPathManager.getDirPath('bug finder', mdlName);
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, Name), '.', rptFormat];
        
    case 'code prover'
        Name = ProjectNamingManager.getNameStr('code prover report', mdlName);
        Path = ProjectPathManager.getDirPath('code prover', mdlName);
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, Name), '.', rptFormat];
        
    case 'code metrics'
        Name = ProjectNamingManager.getNameStr('code metrics report', mdlName);
        Path = ProjectPathManager.getDirPath('code metrics', mdlName);
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, Name), '.', rptFormat];
        
    % 动态测试报告类型
    case {'HLR sim report', 'HLR simulation report'}
        Name = ProjectNamingManager.getNameStr('HLR sim report', mdlName);
        Path = ProjectPathManager.getDirPath('HLR sim results', mdlName);
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, Name), '.', rptFormat];
        
    case {'HLR SIL report', 'HLR SIL report (instrumented)'}
        Name = ProjectNamingManager.getNameStr('HLR SIL report (instrumented)', mdlName);
        Path = fullfile(ProjectPathManager.getDirPath('HLR SIL results', mdlName), 'instrumented');
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, Name), '.', rptFormat];
        
    case {'HLR PIL report', 'HLR PIL report (instrumented)'}
        Name = ProjectNamingManager.getNameStr('HLR PIL report (instrumented)', mdlName);
        Path = fullfile(ProjectPathManager.getDirPath('HLR PIL results', mdlName), 'instrumented');
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, Name), '.', rptFormat];
        
    case {'LLR sim report', 'LLR simulation report'}
        Name = ProjectNamingManager.getNameStr('LLR sim report', mdlName);
        Path = ProjectPathManager.getDirPath('LLR sim results', mdlName);
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, Name), '.', rptFormat];
        
    case {'LLR SIL report', 'LLR SIL report (instrumented)'}
        Name = ProjectNamingManager.getNameStr('LLR SIL report (instrumented)', mdlName);
        Path = fullfile(ProjectPathManager.getDirPath('LLR SIL results', mdlName), 'instrumented');
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, Name), '.', rptFormat];
        
    case {'LLR PIL report', 'LLR PIL report (instrumented)'}
        Name = ProjectNamingManager.getNameStr('LLR PIL report (instrumented)', mdlName);
        Path = fullfile(ProjectPathManager.getDirPath('LLR PIL results', mdlName), 'instrumented');
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, Name), '.', rptFormat];
        
    case 'test generation report'
        Name = ProjectNamingManager.getNameStr('test generation report', mdlName);
        Path = ProjectPathManager.getDirPath('LLR test cases', mdlName);
        rptFormat = getReportFormat(type);
        rptPath = [fullfile(Path, Name), '.', rptFormat];
        
    otherwise
        Name = [mdlName '_' strrep(type, ' ', '_') '_Report'];
        Path = ProjectPathManager.getDirPath('model verification', mdlName);
        rptFormat = getReportFormat('default');
        rptPath = [fullfile(Path, Name), '.', rptFormat];
end

end
